<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阿芊 - 生日礼物在这里</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .login-container {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            text-align: center;
            max-width: 400px;
            width: 100%;
        }

        h1 {
            color: #ff69b4;
            margin-bottom: 30px;
            font-size: 2em;
        }

        .input-group {
            margin-bottom: 20px;
        }

        input {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s;
            outline: none;
        }

        input:focus {
            border-color: #ff69b4;
        }

        button {
            background: #ff69b4;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: transform 0.3s, background 0.3s;
        }

        button:hover {
            background: #ff4da6;
            transform: scale(1.05);
        }

        .error-message {
            color: #ff4444;
            margin-top: 10px;
            display: none;
        }

        .hearts {
            position: fixed;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
        }

        .heart {
            position: absolute;
            width: 20px;
            height: 20px;
            background: #ff69b4;
            transform: rotate(45deg);
            animation: heartFloat 4s ease-in infinite;
            opacity: 0;
        }

        .heart::before,
        .heart::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            background: #ff69b4;
            border-radius: 50%;
        }

        .heart::before {
            left: -10px;
        }

        .heart::after {
            top: -10px;
        }

        @keyframes heartFloat {
            0% {
                transform: rotate(45deg) translateY(0) scale(0);
                opacity: 0;
            }
            20% {
                opacity: 0.8;
            }
            100% {
                transform: rotate(45deg) translateY(-800px) scale(1);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="hearts" id="hearts"></div>
    
    <div class="login-container animate__animated animate__fadeIn">
        <h1>🎂 公主请收礼 🎂</h1>
        <div class="input-group">
            <input type="password" id="password" placeholder="请输入取件码..." autocomplete="off">
        </div>
        <button onclick="checkPassword()">取件</button>
        <p class="error-message" id="error-message">取件码是「6位数」哦～</p>
    </div>

    <script>
        // 创建漂浮的心形
        function createHeart() {
            const heart = document.createElement('div');
            heart.className = 'heart';
            heart.style.left = Math.random() * 100 + 'vw';
            heart.style.animationDuration = (Math.random() * 2 + 3) + 's';
            document.getElementById('hearts').appendChild(heart);
            
            setTimeout(() => {
                heart.remove();
            }, 5000);
        }

        // 每隔一段时间创建一个心形
        setInterval(createHeart, 300);

        function checkPassword() {
            const password = document.getElementById('password').value;
            const errorMessage = document.getElementById('error-message');
            
            // 这里设置密码为 "happy"，你可以修改为你想要的密码
            if (password === "031025") {
                window.location.href = 'transition.html';
            } else {
                errorMessage.style.display = 'block';
                document.getElementById('password').value = '';
                
                // 晃动效果
                const container = document.querySelector('.login-container');
                container.classList.add('animate__animated', 'animate__shakeX');
                
                // 移除晃动效果，以便下次可以再次触发
                setTimeout(() => {
                    container.classList.remove('animate__shakeX');
                }, 1000);
            }
        }

        // 添加回车键监听
        document.getElementById('password').addEventListener('keypress', function(event) {
            if (event.key === 'Enter') {
                checkPassword();
            }
        });
    </script>
</body>
</html>
